Repository navigation
Conversation
v0.56 changes graph meaning (framework resolvers, synthesis, VB.NET, grammar bumps), so the extraction version moves once, first, to 23. A v0.55 index (schema 10, extraction version 22) is Outdated and upgrades through the existing full migration; v0.55 reports a version-23 index as Future and writes nothing. - upgrade_from_v055 covers the paths upgrade_from_v054 covers (CLI sync, catch-up, the cold MCP session's daemon upgrade, an older uninit stays Uninitialized, a failed upgrade still refuses, interrupted builds, tombstones and missing databases are skipped) over a fixture the official v0.55.2 linux-musl binary wrote; checksum, attestation and commands are in its README. The shared helpers move to tests/upgrade_support unchanged. - upgrade_from_schema_9 downgrades a fresh init of the mini corpus to schema 9 instead of planting rows from 3878d52, so its comparison with a fresh init checks only the migration. The release fixture keeps a third test that checks the in-place migration alone.
A database whose schema_versions records a version above this binary's was written by a newer codegraph (OD-19). Reads, status, sync, MCP, the daemon, init and index --force now refuse it before they change a byte, and the error names both versions. ensure_schema_and_migrations returns MigrationError::NewerSchema before it creates a table, migrates or analyzes. The newer version may sit only in an un-checkpointed write-ahead log. The writers that tolerate a live log (an incremental sync, the daemon's recovery of a dead owner's log) and every rebuild entry (before an explicit init removes a copied project's state slots, before a lockless root gets its lock, before building is published) decide from schema_probe: the main file plus the log's committed frames, applied in memory the way SQLite's recovery does, so no -wal or -shm is created or folded. A file that is not SQLite is still replaced; a database whose version cannot be read is refused, and the error says nothing changed. uninit --force skips the check and stays the way to discard such an index; the refusal offers it only for the states uninit accepts. status reports the index as current with initialized false and both versions.
test_engine() returned an engine over /tmp/cg-mcp-engine-{pid}-{seq} and
never removed the directory, so a reused pid opened a stale index and
engine tests failed locally. TestEngine derefs to the engine, removes a
stale directory before it creates one, and on drop closes the engine
before removing its directory.
The member-path std gate deferred on 2026-10-03 needs no code: the v0.55 port of upstream #2169 already keeps a receiver whose declared type the project does not declare (PathBuf, &Path, std::path::PathBuf) from binding a project method by name. The probe pins it: index_root.join, base.join, p.join and q.join stay unresolved and reach no LineIndex::join, while env.set() still reaches EnvGuard::set.
Takes dependabot #334 except tree-sitter-swift: tree-sitter 0.27.1, tree-sitter-language 0.1.9, erlang 0.21.0, php 0.25.1, scala =0.26.3, cfml 0.26.43, and the windows-sys reselection. Every golden, the four precision corpora and this repository index identically before and after. tree-sitter-swift stays at =0.7.3 (OD-B4). 0.7.4 fixes the scanner line behind upstream #2683 (`1UL << 32`, which MSVC folds to 0, so the Windows build reads `try! Foo()` as a call of `! Foo`), but it also regenerates the grammar: a call after an infix or prefix operator (`a + b.c()`, `!a.b()`) comes out as another tree, which the walker does not read as a member call. Upgrading it lost an exact-match edge in the swift golden and turned two Alamofire callees into whole expressions; the upgrade waits for that walker change. The #2683 probe pins calls after try!, try? and try. It is ignored on Windows until the upgrade; with the scanner line changed to what MSVC compiles it to, it fails on Linux the way upstream observed on Windows. No real Windows host was used. The grammar manifest records the held version, and languages.md the Windows limitation.
A Current index beside the uninit tombstone (an init that published Current but could not remove it) refused uninit --force with CurrentTombstoned. With a schema a newer codegraph wrote, init refuses that index and names uninit --force, so the refusal pointed at a command that then failed. Uninit's corroboration now accepts the tombstone: it discards the index like any other Current one and keeps the tombstone, so only init rebuilds it. Covered with and without a newer schema, in the store and through the CLI.
A Current index beside the uninit tombstone was reported as tombstoned before its schema was read, so status named `codegraph init` as the recovery even when a newer codegraph wrote the database, and init then refused it. When the tombstone is present, the corroboration now reads the schema version first (the write-ahead-log-aware probe, which touches no file); a positively newer version is FutureSchema, which offers uninit --force. Any other outcome is still CurrentTombstoned, so the same-version contract and its init recovery are unchanged.
A refusal of a newer codegraph's index offered `uninit --force` for every state uninit accepts, but on a Current namespace uninit first corroborates the database's extraction stamp. With the stamp missing, malformed or not this binary's, the offered command then failed. The offer now runs the same read-only corroboration uninit runs before its first change, for the tombstone precedence in the read gate and for the rebuild prologue. A newer schema with a bad stamp, tombstoned or not, is refused without the offer.
status's human output for an index a newer codegraph wrote always named `uninit --force`, even when the refusal it reports does not offer it because uninit would refuse the index (a missing or foreign extraction stamp). It now follows the refusal: upgrade, plus the uninit recovery only where uninit would discard the index.
Moving the shared helpers to tests/upgrade_support left upgrade_from_v054 and upgrade_from_v055 using ExtractionStatus and Store only in their unix-only tests, so the Windows Clippy job failed on unused imports. The import is now cfg(unix).
The groundwork the routers of the next commits draw their edges with (F1, upstream #2129 and #2395). No registered resolver uses the new pieces yet, so every golden and the express, typescript-large and self-index graphs are unchanged. - EdgeKind::Navigates, stored as text like every edge kind. Callers, callees, the named-symbol flow and a flow's boundary follow it, as upstream's traversal, FLOW_EDGE_KINDS and CONTINUATION_KINDS do. - A ResolvedRef can carry an EdgeShape (upstream edgeKind, metadata and alsoTargets): the edges' kind, the metadata on the target's edge, and more targets, each its own edge under the same kind and confidence. ResolvedRef::new builds the plain resolution every resolver returned before. - frameworks/package_deps reads the dependencies a project declares in its root package.json and up to 24 nested ones: one or two directories down, then deeper above JavaScript-family code, never inside node_modules. React and NestJS detect through it, so an app whose manifest is in frontend/, apps/web/ or src/Web/ClientApp/ is detected without its fallback evidence. Upstream package-deps.ts is unchanged between b635dd46 and e8ddc4e2. - A framework can name its app dependencies (appDependencies). When a manifest declares one, its extractor runs only on files whose nearest package.json naming such a framework names it. The frameworks row a sync compares adds a digest of where each gated framework runs, so a manifest edit that moves an app re-extracts every file, as a framework that came or went does. The JS control inputs digest every manifest detection may read, so a sync notices one appearing beside no script. - The trait gains cross_file_nodes and navigation (upstream #2400 and #2425), both None by default; nothing calls them until a router implements them. The sync matrix gains two cases: React declared in an app's manifest, and in a manifest one directory down above no script. The gating sync case waits for the first gated framework (W7-07).
An edge a framework resolver made now names that resolver in
metadata.framework (upstream #2159), as a synthesized edge names its
pass in synthesizedBy: a Tauri invoke('greet') says `tauri`, a Godot
autoload call `godot`. The orchestrator adds it to every result a
framework's resolve returns, before the confidence race, so a lower
confidence framework result that wins later carries it too. When a
resolution reaches several targets, only the edge to the first carries
it, as upstream's does; the others keep the metadata the resolver gave
each.
Goldens: godot's four autoload calls and routers' one Vue-resolved call
gain the key; no edge, node or reference comes or goes. The same holds
for this repository (2 edges) and typescript-large (590 edges, all
`react`).
Framework detection reads the manifests one or two directories down from every indexed file, whatever its language (upstream #2395), and the JS control-input row digests every such candidate. The watcher re-read that row only when a JS-family file came or went, so a file of another language arriving in a new directory left the row behind a fresh index: 39 cases of the sync matrix (CFML, C, C++, C#, Dart, Go, Java, Kotlin, Liquid, Lua, Objective-C, PHP, Python, Rust and Solidity edits) failed under the watch driver. The graph itself converged, since a sync with changes re-detects the frameworks anyway. The control-input check now counts any file that comes or goes as touching the JS kind. typescript_react_dependency_beside_an_added_script covers it directly: React declared in frontend/package.json is detected once frontend/build.py is indexed, and the sync records that manifest as a fresh index does.
…ts; typed styled components
React resolution now follows upstream b635dd46 (#2120's React half,
#2240, #2429, #841, #2475's static half and #2420's wrapper half):
- A component, hook or context the file imports is the import's: a
UI kit's `<Button>` or @tanstack/react-query's `useQuery` no longer
binds a project namesake, and a project module's is import
resolution's to find (#2120, #2475).
- A hook nested inside another function is never a target, and the
file's own hook comes first (#2120). In a JS/TS module another file's
hook or context is reached only through an import, never by bare name
(#2240), and `f?.()` is a bare call, so an optional call no longer
binds a class member or a property.
- A PascalCase name a .tsx/.jsx file declares as a module-level value
is that declaration wherever the file uses it: the function the value
wraps (`observer(function X() {…})`, `forwardRef(Inner) as …`), else
the declaration, never another app's same-named component (#2420).
The lazy loader half needs W7-09's reader.
- A PascalCase const declared through forwardRef/memo (bare or `React.`)
or a styled-components/emotion tag (`styled.x`…``, `styled(Base)`…``,
typed `styled.x<P>`…``, #2429) is a `component` node, and an inline
render function's calls are the component's (#841). React's extract no
longer mints regex component/hook duplicates of tree-sitter nodes; it
emits routes only, now from .tsx/.jsx files too.
js_scan ports the bracket and string scanner upstream reads declarations
with, iteratively, so deeply nested source cannot exhaust the stack.
Goldens: routers gains the four .tsx page and data-router routes and one
route -> Layout edge; synthesis loses the regex `useCartStore` hook node
(log row in docs/equivalence.md). Precision: express-medium identical;
this repository +4 routes, -8 regex hook duplicates, and a Svelte
`onclose?.()` is now unresolved, as upstream; typescript-large and
LibreChat sampled 20 + 20 rows each, no wrong edge introduced.
LibreChat loses 919 reference sites in the interim: 857 behind the
`~/` alias its client/tsconfig.json declares (Rust reads only the root
tsconfig; upstream #2165's nearest-config aliases come with W7-09) and
62 rendering a module whose default export is `memo(X)` (#2563's
static half, W7-09). Upstream landed #2120 before #2165 the same way.
The sync matrix gains tsx_route_element_body_edit and
tsx_wrapper_value_body_edit; the react_dependency cases observe a data
router's route instead of a regex hook node. Upstream's later react.ts
rows #2737 (PORT) and #2738 (PARTIAL) are left for the next round.
…sioning
In a TS/JS module the provider convention (`*Service`, `*Controller`, …)
now takes only the reference's own class or the convention file beside
it (users.controller.ts -> users.service.ts); anything farther is import
resolution's or name matching's (upstream #2246). Nest's own specs'
`TransientService` no longer reaches an integration app's, and a
decorator call `@Controller('users')` no longer instantiates a PHP class
named `Controller`.
A NestJS route is named by the path a request takes to it (upstream
#2117). post_extract reads each `NestFactory.create` bootstrap and
renames the routes of its app's controllers in NestJS's order,
`/{prefix}/{v}{version}/{RouterModule prefix}/{path}`:
- `exclude` paths (plain, `{ path, method }`, `{/*wildcard}`, `(.*)`,
`*`) skip the prefix and keep their version;
- a route's version is its own `@Version` (found past decorators with
object arguments), else its class's `@Version` or `@Controller({
version })`, else `defaultVersion`; `VERSION_NEUTRAL` has none, and
header or media-type versioning adds no segment;
- a computed prefix is not guessed; each app takes the bootstrap with
the longest root above it, a seed script that creates the app without
serving it does not displace the one that configures it, and an app
that sets nothing keeps its routes as written;
- only a route whose decorator sits in a `@Controller` is renamed.
A route keeps its id and qualified name. One an earlier pass renamed
that nothing renames any more (a removed global prefix, version or
RouterModule entry) gets the name its file gives it back, so a sync
converges with a fresh index; before, a removed RouterModule entry left
the old name, as colby's sync does. The decorator regexes are compiled
once, since the pass now scans controller files on every sync.
Goldens: servers' NestJS route becomes `GET /api/v1/users/:id` (log row
in docs/equivalence.md). Precision: express-medium and typescript-large
identical; this repository renames that route and drops the PHP
`Controller` guess; nestjs/nest's samples and specs move 43 provider
references from another app's class to the spec's own and resolve 14
more. Its 302 routes without a bootstrap of their own take the `/api` of
the one root-level e2e spec that sets one, by upstream's bootstrapFor.
A sync of typescript-large declaring @nestjs/core takes 2.8% longer
(median of three).
The sync matrix gains four NestJS cases and checks node names. The
Express and cross-tier halves of upstream's test come with W7-19a and
W7-20.
…component Nuxt's file routes move from the Vue resolver to their own `nuxt` resolver (upstream #2130), detected by a `nuxt`, `nuxt3` or `@nuxt/kit` dependency or a `nuxt.config.*` file, and gated to the apps whose nearest manifest declares one (#2129). A plain Vue app keeps its views in a `pages/` folder just as often, and those are components a router config names, not addresses: halo's console no longer makes a route of each of them. Every path gets a leading `/` before the `pages/`, `server/api/` and `middleware/` searches, so a Nuxt app at the repository root finds its endpoints and middleware as a nested one does; a top-level `pages/index.vue` is `/`, and a `server/api/` file takes a page's param syntax (`[id]` -> `:id`, `[...slug]` -> `*slug`; `index` is the folder's path, `/api` at the top). A page route `calls` the component its own file is (#2267, new `frameworks/page_component.rs`): the route says so by the file's basename, and the resolver lands it on that file's component only, never on a same-named one elsewhere (every `index.vue` is a component named `index`). The viewer's routes list counts a component as a route's handler, so a Nuxt page is listed with the component that serves it. Goldens: routers' Nuxt index route becomes `/` (its id moves) and its two pages gain a `framework` edge each (log row in docs/equivalence.md). Precision: express-medium and typescript-large identical; elk's 59 pages each reach their own component, its root route is `/` and its four `server/api/` routes appear; halo's console loses 12 routes that were components. The sync matrix gains three Nuxt cases: a `nuxt.config.ts` appearing, an app's manifest coming to declare Nuxt, and a page's template edit. The Astro half of #2267 comes with W7-19a, and #2130's Vue Router admin-template half with W7-11. Upstream's later change to vue.ts (#2633, 986de95c: `@/`/`~/` imports left to the import resolver) is left for the next round.
Explore opens with the call path among the symbols the query names (upstream's Flow section, #365): when two or more named callables are connected by a chain of three or more, one numbered line per symbol and one `↓` line per hop come before the header. The search is named_symbol_flow's, the one the viewer's Flow rides, so of two equally long routes the Flow takes the one through the symbols the query names (#2453's explore half). A hop names the conditions its call runs under (#1655). The new codegraph-graph branch_guards module reads them from the caller's current source with the extractor's grammars: the if/else and ternary arms, switch cases, `&&` / `||` short circuits and catch blocks around the call site up to the enclosing function, and the early exits before it, negated, for JavaScript, TypeScript, Swift, Python, Java, Kotlin, C#, Go, C, C++ and Objective-C callers: `↓ calls (when !busy && ready)`. A caller file that changed since it was indexed, or one above 256 KiB, gets no condition rather than one read at a moved line. Upstream's rules read fwcd's Kotlin grammar and an older Go grammar; this port reads kotlin-ng's tree (arms without control_structure_body, return_expression, a bare break or continue as an identifier) and tree-sitter-go 0.25's statement_list for the same labels, and passes every guard label of upstream's branch-guards tests. codegraph-graph now depends on codegraph-extract for the grammars. A synthesized hop reads as the dynamic dispatch it is, in the Flow and in the codegraph_node trail: `dynamic: interface → impl @src/pdf-exporter.ts:5` (new synthesized_hop module, upstream's synthesized-hop.ts at cd97bb37, #2428). The index has no synthesized edges until the synthesis stage (W7-14), so only the engine test shows the tag for now. Not in this commit: the dynamic-dispatch links among the named symbols (W7-26), boundary and polymorphic-dispatch announcements for a flow that does not connect (the port keeps its boundary scan over the explore seeds), and the spine's weight in file ranking and body windows (W7-25). Upstream's interface cases of #2453 need interface-impl edges and come with W7-14. Upstream rows left for the next round: #2750 (f5dfa21f, PORT, named-symbol-flow.ts), #2769's branch-guards hunk (6bd217a2, PARTIAL, the Steps status reader this commit does not port), and the explore rows #2783 (1890b10c, PARTIAL), #2789 (214ef50e, PORT) and #2557 (5da4a41d, PARTIAL). Goldens and the MCP fixtures are unchanged: the mini fixture's query `Counter add runDemo` connects no chain of three, because runDemo calls add directly and the walk reaches it first.
A `NestFactory.create` in a test file (an e2e spec) with no `src/`
segment above it now belongs to the directory above its test folder
(`integration/security/` for `integration/security/e2e/csrf.spec.ts`),
or to the directory holding it. Within one app root, the bootstraps of
the app's entry points decide over a test's: an e2e spec's
`setGlobalPrefix('api')` does not rename the routes `src/main.ts`
serves.
W7-02 ported upstream b635dd46's appRootOf and bootstrapFor as they
are. They put every such spec at the repository root and prefer the
bootstrap that configures the app, so on nestjs/nest one integration
app's spec gave its `/api` to 306 routes of ten other integration apps
and packages/core's specs. With this change only
integration/security's own routes and sample/24's keep `/api`.
express-medium and typescript-large are identical, and no golden
changes. This is a deliberate difference from upstream (KEEP-RUST,
recorded in KNOWN_DIFFS.md). It answers the W7a sub-wave gate's first
round.
W7-04 (9ef9f69) names the resolver on the edges a framework resolution draws (`metadata.framework`, upstream #2159) without adding a sync case of its own. The plan requires one for every commit that changes crates/codegraph-resolve/src. The matrix harness gains `edge_metadata_after`, which requires an edge of the fresh index to hold a value under a metadata key. Each sync is already compared with the fresh index by every metadata key. Two cases use it: - tauri_command_body_edit_keeps_the_invoke_edges_resolver_name: an edit to a Tauri command's body re-resolves the TypeScript `invoke('greet')` at its site, and the edge keeps `framework: "tauri"`. - tsx_framework_edge_keeps_its_resolvers_name: a `.tsx` file is re-extracted, and the React-resolved edge to the function a component value wraps keeps `framework: "react"`. Both cases fail if W7-04's naming is removed (the fresh index lacks the key). They also fail if the incremental resolution drops the name (the sync differs from the fresh index). Only test files change.
Next.js gets a resolver of its own, as upstream F3 (9c6bc23b) split
nextjs.ts out of react.ts. React's old rule read any `pages/` or `app/`
file with a default export as a page, kept route groups in the path
(`/(commonLayout)/tools/custom`) and drew no edge.
- A page is a route named by the path a request takes: a `(group)` is no
segment, `[slug]` is `:slug`, `[...all]` and `[[...all]]` are `:all*`.
It `calls` its default export. A `route.ts` handler is one
`METHOD /path` endpoint per exported method, referencing it; a
`pages/api/` file is `ANY /path`. Layouts, `_app`, configs, tests and
parallel or intercepting routes are no route.
- Next is detected by a `next` dependency, or a `next.config.*` beside a
route file, and names `next` as its app dependency (#2129): in a
monorepo it reads only the apps whose manifest declares it.
- `router.push` / `replace` / `prefetch`, `redirect`,
`permanentRedirect` and `NextResponse.redirect(new URL(...))` under a
Next app become a `navigates` edge to the page their href names, with
the `href` and `navMethod` in its metadata; each arm of a conditional
is an edge. The href readers and the matcher are upstream's Expo Router
ones, in a new shared `route_href` module: a string, a template whose
holes fill parameters, a `{ pathname }` object, a local `const href`.
A computed href, a relative one or a path no page serves stays
unresolved.
- When several pages serve one path (two apps of a monorepo with
`/login`), a call goes to its own app's page; several or none there
is nothing. Upstream keeps the last page in node order, which a sync
changes (KEEP-RUST, recorded in KNOWN_DIFFS.md).
The routers golden is rewritten (log row in docs/equivalence.md): the
three Next page routes take upstream's ids and gain their `calls` edges,
`GET /api/auth` appears, and the Dashboard's `router.push('/')` becomes
a `navigates` edge. On Dify's Next.js web the 31 page routes lose their
route-group segments, each calls its own file's component, and 27
navigation calls reach the pages they name; express-medium,
typescript-large and LibreChat are identical, and halo loses the
`/module` route React's rule made of a Vue console file.
Not in this commit: `<Link href>` and `<a href>` (a synthesizer, not a
call), the Screens and Steps builders that read these edges, and the
sync retry for a navigation call whose page appears later in another
file (upstream #2425).
Expo Router gets a resolver of its own (upstream F2, expo-router.ts at
b635dd46, with #2135's API routes).
- A file under `app/` or `src/app/` is a screen named by its path: a
`(group)` is no segment, `[id]` and `[...rest]` stay as written, an
`index` is its directory, a platform suffix (`.ios.tsx`) is dropped.
The route `calls` the file's default export. Layouts and the other `_`
and `+` files are no screen, except `+not-found`. A `+api` file is one
`GET /path`-style endpoint per exported method, referencing it (#2135).
- Expo Router is detected by an `expo-router` dependency, or an
`app/_layout` beside an `app.config.*`, and names `expo-router` as its
app dependency (#2129).
- `router.push`, `replace`, `navigate` and `dismissTo`, and a project's
own wrapper named for the verb (`safePush`), become a `navigates` edge
to the screen their href names, through the shared href readers; a
relative href is read from the calling screen's directory, and a
wrapper is remembered as `via`.
- A call matches only the screens of its own Expo app, the longest
directory above an `app/` that holds it; a file under no Expo app is
not read, and a path two screens of that app serve stays unresolved
(KEEP-RUST, recorded in KNOWN_DIFFS.md). Upstream keeps one table for
the project and reads every file: in the routers corpus, the React
Router app's `navigate('/')` reached the Expo app's `/` screen.
The Next.js resolver's duplicate-path rule moves into route_href as a
shared `ExactTable`, and the routers' unit tests share one test context.
The routers golden is rewritten (log row in docs/equivalence.md): the
Expo app's `/` and `/settings` screens and its `GET /api/hello`
endpoint appear, and the index screen's `router.push('/settings')`
becomes a `navigates` edge.
A monorepo app declares its own `paths` (`@/*`, `~/*`) in a tsconfig.json or jsconfig.json below the repository root, and only the root's aliases were read: LibreChat's `~/hooks`, bulletproof-react's per-app `@/lib/auth` stayed unresolved, and since imported names wait for import resolution (#2120) their calls, tags and imports lost their edges. - An import tries the aliases of the config nearest the importing file first (walking up its directories, the root excluded; a directory counts only when its tsconfig.json or jsconfig.json yields aliases, so a lone tsconfig.base.json does not), then the root's. Upstream #2165 (getNearestAliases). Both resolution contexts cache the lookup per directory. - An importing path that is absolute or climbs with `..` never walks. - Sync re-resolves the JS class when an ancestor directory's tsconfig.json or jsconfig.json appears, changes or goes away, or a config one of them extends changes. Precision against the previous commit: express, typescript-large, this repository, adifyweb and mantis identical; bulletproof-react and LibreChat lose no site and gain 898 and 6665, each in its own app or package.
React Router routes were read by a v1.0 regex scan that named a nested
route by its own segment (`login`, `c/:conversationId?`) and never read a
route object whose path is a constant or whose page loads lazily, and a
navigation call (`navigate('/login')`, `history.push(…)`) resolved to
nothing.
- A structural scanner, ported from upstream's `scanRoutes` (the part
that reads one file), reads `<Route>` elements and the route objects of
a file that makes a router: nested paths compose, an index route is
its parent's address, a route around others is the layout they render
inside (`references` with `layout: true`), `lazy: () => import(…)`
renders the module's default or `Component` export, an `<Outlet />`
route renders nothing of its own, and `path={paths.x}` is a route the
file does not spell out. A path built from a constant
(`paths.app.root.path`) is named in `post_extract`, which now runs
before resolution in index, migration, sync and the orphan sweep, as
upstream's does, so a fresh index and a sync agree.
- A `react-router` resolver turns `history.push`/`replace`,
`navigate(…)`, `router.navigate(…)` and `redirect(…)` into `navigates`
edges carrying the href, matched against the routes of the caller's own
app: a literal, a template with holes, a `{ pathname }` object, a local
`const href`, `paths.x.getHref(id)`, every arm of a conditional.
Upstream F4 (#2165, #2187, #2400, #2423, #2436, #2558, #2670).
- KEEP-RUST: a path two routes of one app serve stays unresolved rather
than taking the first in node order, and a route file nested past 256
levels yields no routes rather than running the stack out.
Precision against the previous commit: express, typescript-large,
adifyweb and mantis identical; this repository changes only the routers
fixture, as its golden; bulletproof-react gains ten constant-path routes
and three navigation edges; LibreChat's 14 relative routes become 16
composed ones and seven navigation calls resolve. Upstream's first-wins
table would resolve one more call (bulletproof's `navigate('/app')`).
A data-router `lazy` loader that picks the export it renders (`const {
TestTab } = await import('./tabs'); return { Component: TestTab }`) was
read for its first import, so the route rendered the module's default or
`Component` export, and a barrel of tabs has neither. A module-level value
a lazy wrapper loads (`Loadable(lazy(() => import('./Register')))`) was
bound by name, so a tag naming it reached another app's same-named page.
- The loader readers, ported from upstream (#2480), follow what a loader
hands back: a destructured or `.then`-picked export, `(await
import('./x')).Page`, a module binding, `Promise.all`, an `async lazy()`
method, React Router 7's object of lazy properties, the page an
`element` shows past a guard, or a component of the route file. The
route's reference names the pick (`import:./x#Page`), which the React
resolver finds through barrels, only for a React route's reference. A
loader that hands back `Outlet` renders nothing of its own (#2670); one
that hands over only a `loader` makes no page.
- A PascalCase value the file declares is, wherever the file uses it, the
component of the module its lazy wrapper loads, through `Loadable`,
`dynamic(…, options)`, a loader option or either branch of a
conditional (#2420, #2452's route half).
- KEEP-RUST: a loader nested past 256 levels links nothing rather than
running the stack out.
Precision against the previous commit: express, typescript-large, this
repository, adifyweb, bulletproof-react and mantis identical; LibreChat's
two tags naming a same-file `lazy()` value (`<AccountSettings>`,
`<BookmarkNav>`) reach the component of the module it loads instead of the
value itself.
A route table written in one file and handed to the router in another
(`useRoutes(routes)`, `createBrowserRouter([MainRoutes, LoginRoutes])`,
`AppRoutes.map((route) => <Route {...route} />)`) made no routes: the
scanner read only the route objects of a file that makes a router
itself.
- The table pass, ported from upstream (#2400, #2423, #2668, #2672),
starts from every non-test file that imports React Router and hands a
table over, finds the table where it is declared, imported or
re-exported, or as what a function a value calls returns (through
`useMemo` too), and makes its route objects, and the tables they name,
routes under the path they are mounted at. They render inside the
layouts around the mount only when the table is written in the same
file. A navigation call binds to these routes as to any other.
- The routes are cross-file nodes (`route:<file>:<line>:table:<path>`):
a pass after the constant naming compares the routes the tables give
now with the stored ones, before anything resolves, in an index, a
migration, every sync and the orphan sweep. The edges that reached a
removed route are resolved again; a sync withdraws its markers only
when the pass changes the store, and a re-extraction of a file keeps
the references of the routes in it.
- KEEP-RUST: a route whose name or references changed is deleted and
inserted again with its new references, where upstream renames it in
place and keeps the old ones; a file nested past the scan bound hands
over no table either.
- The table readers blank comments byte for byte, so an offset found
past a comment holding non-ASCII text still indexes the file.
Precision against the previous commit: express, typescript-large, this
repository, adifyweb and bulletproof-react identical; LibreChat gains
the three routes of `client/src/routes/Dashboard.tsx`, which its router
names among another table's children, and mantis the eight routes of
its `MainRoutes.jsx` and `LoginRoutes.jsx`; nothing removed.
A tag whose name the file imports from a module of the project kept
import resolution's or name matching's target: the module's first
exported function (`getToolIconType` for `<ToolIcon>`), a memo
wrapper's bodyless node, a type alias, or a same-named declaration
elsewhere, and nothing when the module's default export wraps the
component (`export default memo(HoverButtons)`) or an index forwards it
(`export { default as X } from './X'`).
- React binds such a tag, ported from upstream (#2563), to the
component the module exports under the imported name: through an
index that forwards it, past a wrapper around it, or through a value
holding another module's component. Where import resolution already
reaches that component, its edge stays.
- KEEP-RUST: where the module exports no component under the name, the
tag keeps import resolution's edge; upstream's `jsx-render` pass
draws nothing there.
- The module surface a dependent re-resolves on covers the imports a
module's own exports forward, read the way React reads them (each
declarator of a statement, past a type annotation; row format 3), so
an index that re-points what it forwards moves the tags behind it on
sync, as a fresh index does.
Precision against the previous commit: express, typescript-large, this
repository and mantis identical. Every change is a tsx tag's
`references` edge, now the module's (`framework`, 0.9): LibreChat 181
sites (75 bound where they were unresolved, 47 retargeted, 59 the same
target), adifyweb 1038 (944, 90, 4), bulletproof-react 434 (the same
target); no tag lost its edge.
A TanStack Router app had no routes in the graph: its
`createFileRoute('/posts/$postId')` pages and `createRoute({
getParentRoute, path })` trees were plain calls, and its
`navigate({ to })` and `throw redirect({ to })` calls stayed unresolved.
- A resolver, ported from upstream, extracts one route per address.
File routes take their path from the literal (`$x` is `:x`, a
trailing `$` a splat; pathless `_layout` segments and `(group)`
folders are not in the URL); an index route wins its address over
the layout around it, and a layout file (`*.route.tsx`, or one that
renders `<Outlet />`) is no page. Code routes are composed through
`getParentRoute` within their file. Each route calls its component.
- `navigate`, `redirect`, `router.navigate` and `Route.navigate` bind
to the route of their own app that the `to` pattern names, as a
`navigates` edge with `href` and `navMethod`. The resolver is
detected by any of the five TanStack Router and Start packages and
runs after React Router and before Next.js, as upstream orders the
routers.
- KEEP-RUST: a pattern two routes of one app serve stays unresolved,
as React Router's does; upstream keeps the first in node order, which
a sync changes.
- KEEP-RUST: a framework result inside a module that exports nothing is
dropped like a name match's, so a route tree in a `main.tsx` that only
renders is reached only from that file.
Precision against the previous commit: express, typescript-large,
LibreChat, adifyweb, bulletproof-react and mantis identical; this
repository gains its routers fixture's two TanStack routes. Five
TanStack Router examples gain 27 routes, 26 route-to-component edges
and 3 navigations. One component edge picks another file's same-named
function in the directory, as upstream's component rule does.
A Vue app's routes table was plain data:
`createRouter({ routes: [...] })` and an admin template's
`constantRoutes` named no route, and `router.push({ name: 'login' })`,
the way Vue apps navigate, stayed unresolved.
- A resolver, ported from upstream, reads the routes tables of a file
that builds a router, imports `vue-router`, writes a `routes` array
or sits in a `router/` directory: one route per entry, a child's
path joined onto its parent's (`children` read only from an array
written in place). A route references its parents' components as
layouts; a parent that a child's path claims or that redirects is a
frame, not a page.
- A route calls the component its import takes: a named import the
module's exported node of that name, through export lists and
re-exports; a default import or a lazy `() => import(...)` the
module's default export, a `.vue` file's own component. The module
is the one the router file's import resolves to, or, through an
alias import resolution misses, the one file of the app whose path
ends the same way. KEEP-RUST: the route's reference to an identifier
is `component:<name>`, which only this resolver answers, so an import
it cannot follow binds no namesake; upstream takes the module's first
component-like function and falls back to any component of the name.
- `router.push`, `router.replace` and `this.$router.push` bind by name
to the route of their own app that the table names so, else by path
to a config route or a Nuxt page, as a `navigates` edge with `href`
and `navMethod` (and `by: name`). KEEP-RUST: a destination is read
only when it is whole (a string, a template whose holes fill whole
segments, a conditional of them, a local initialized to one, an
object's own `name` or `path`), so `'/redirect' + fullPath` reaches
nothing; and a name or a path that more than one entry of an app
carries stays unresolved, where upstream keeps the first.
- The resolver is detected by `vue-router`, `nuxt` or `nuxt3` and runs
after Next.js and before Expo Router, as upstream orders the routers.
A bare `navigateTo` now passes the name filter as a navigation call,
and the Vue resolver answers it first as a Nuxt auto-import, an edge
to its own caller, as upstream does at the audited revision.
Precision against the previous commit: express, typescript-large,
LibreChat, adifyweb, bulletproof-react and mantis identical; this
repository gains its routers fixture's Vue routes. Across six Vue apps
and the fixture: 92 routes, 92 route-to-view edges and 62 layout
references, each to the component its entry names, and 15 navigations.
A SvelteKit app's pages were plain components:
`src/routes/+page.svelte` and `src/routes/blog/[slug]/+page.svelte`
named no route, `goto('/login')` and `redirect(303, '/')` stayed
unresolved, and some `$lib/...` imports reached nothing.
- A `svelte` resolver, ported from upstream, makes each `+page.svelte`
under a `routes/` directory a route named by its directory: a
`(group)` folder is no part of the address and a parameter's
`=matcher` no part of its name (upstream #2131), `[[lang]]` is
`:lang?` and `[...rest]` is `*rest`. A layout, an error page, an
endpoint or a loader is no route.
- It resolves what Svelte's and SvelteKit's conventions name: a rune is
the compiler's, `$app/*` and `$env/*` are SvelteKit's own modules,
`$lib/x` is the file `src/lib/x` of the importing file's app, and a
capitalized call names a component. KEEP-RUST: `$lib` is read from
the importing file's app rather than the repository root, a store
subscription binds only the store its own component declares, and a
component call binds only the one component of its name in the
calling file's directory or, failing that, in the project.
- A `sveltekit-router` resolver binds `goto` (destination first) and
`redirect` (destination after the status) to the page of their own
app that serves the path, as a `navigates` edge with `href` and
`navMethod`. A page whose last segment is `[[optional]]` also serves
the shorter path unless another page serves it. KEEP-RUST: a
destination is read only when it is whole, as Vue Router reads it, an
absolute URL reaches nothing, and a path two pages of one app serve
stays unresolved, where upstream keeps the first page in node order.
- Both are detected by their dependencies (Svelte also by any `.svelte`
file) and run after Next.js and before Vue Router, as upstream orders
them. `<a href>` links and a page's join with its loader are synthesis
passes, which come later.
Precision against the previous commit: express, typescript-large,
LibreChat, adifyweb, bulletproof-react and mantis identical; this
repository gains its routers fixture's SvelteKit routes. Across three
SvelteKit apps (sveltejs/realworld, shadcn-svelte, svelte.dev): 45
routes, 17 navigations each to the page its destination names, and 48
`$lib` imports that reached nothing now reach their app's file.
A Go call through a struct field that holds a function
(`d.refreshf(ctx)` in prometheus' refresh discovery) had no target: the
function is whatever a composite literal or an assignment put in the
field. The synthesis stage's last pass (upstream `goFuncFieldEdges`)
links such a call, made on a receiver its scope types (a local, a
parameter or the method's receiver, at most one field or one promoting
embedding away), to each function or method value wired into the field,
directly or through the func field it is copied from (`via`): a keyed or
positional literal (`Options{RefreshF: d.refresh}`), in a function or at
package level, or an assignment (`h.fn = handler`). A conversion to a
func type is read through, and an interface value reaches its one method
of the name. Each field links at most forty values, production wiring
before test wiring, by site in numeric order, and another package's test
wiring never reaches a test's call. The edges are heuristic `calls` with
`synthesizedBy: "go-func-field"`, `field`, `via` and `registeredAt`, and
explore's Flow names the hop: func field `Discovery.refreshf` (set from
`Options.RefreshF`). Generated files are not read.
Upstream keeps one answer per type name and file, whatever the alias
depth it reached it at; here a Go type is followed through at most three
aliases or defined types from whichever name it starts (KNOWN_DIFFS).
The synthesis marker moves to 7, so the next sync recomputes the stage,
and the synthesis corpus gains a refresh and an EC2 fixture.
`locale_compare` moves to `codegraph-core`, beside a numeric form.
Precision: nineteen corpora are identical, gin and kratos-layout among
them. Prometheus' `discovery/` gains 33 `go-func-field` calls, each
checked against the source: 30 from the refresh discovery's `refresh` to
the providers wired through `Options.RefreshF`, and one each for xds'
`parseResources`, dns' `lookupFn` and marathon's `appsClient`.
…vel dispatch synthesis Six framework dispatch shapes had no static edge from the code that dispatches to the code that handles it. The synthesis stage now ports upstream's passes for them (`reduxThunkEdges`, `celeryDispatchEdges`, `springEventEdges`, `mediatrDispatchEdges`, `sidekiqDispatchEdges` and `laravelEventEdges`), each edge a heuristic `calls` with `synthesizedBy`, `via` (the dispatched name or type) and `registeredAt` (the dispatch's file and line): - a `createAsyncThunk` or `createThunk` constant reaches each thunk or action creator its body dispatches (`dispatch(x(...))`), a thunk of the name before any other, at most 24 a constant; - the function around a Celery `task.delay(...)` or `task.apply_async(...)` reaches the task, a Python function under a `@task` or `@shared_task` decorator, the dispatching file's when several share the name; - a Spring `publishEvent(new X(...))` reaches every `@EventListener`, `@TransactionalEventListener` or `ApplicationListener` method of `X`; - a MediatR `Send` or `Publish` on a mediator, sender or publisher reaches the `Handle` of each handler of the sent type, typed from `new X`, an assignment or a declaration; - a Sidekiq `perform_async`, `perform_in` or `perform_at` reaches the worker's `perform`, by qualified name or by a last segment one worker has; - a Laravel `event(new X(...))` reaches each listener's `handle` for `X`, typed or registered in a `$listen` map. The file passes link at most 80 edges a file (200 for Laravel), checked before each dispatch site, and run only when the index has files of their language, as upstream's gates have them; the thunk pass, which reads constants of any language, runs when it has JavaScript or TypeScript files. The synthesis marker moves to 8, so the next sync recomputes the stage, and the synthesis corpus gains a thunk chain, a MediatR handler, a Sidekiq worker and a Laravel listener with their callers. Precision: nineteen of the twenty corpora are identical, and the repository itself gains the two edges of its existing Celery and Spring fixtures. CleanArchitecture, koel, feedbin, plugin-moments and go-api gain only these edges (9 MediatR, 17 Laravel, 97 Sidekiq, 2 Spring and 45 Celery); each passes a per-pass check against the source, and the ones reviewed by hand are correct.
A C or C++ call through a struct's function-pointer field, or through a bare array of function pointers, had no static edge to the functions it can reach. The synthesis stage now ports upstream's `cFnPtrEdges` pass (#932, #991 with its macro-built tables, conditional compilation and bare arrays, and union fields), each edge a heuristic `calls` with `synthesizedBy: "fn-pointer-dispatch"`, `via` (`struct.field` or `array[]`) and `registeredAt` (the dispatch's file and line): - a table, a designated initializer or a field-to-field assignment registers a function in a field of a struct definition, the table read through the file's and its includes' macros, conditionals evaluated under the includer's defined names; - a call through `p->field(...)`, a chain of fields or a subscripted table reaches each function registered in that field, at most 300 a dispatching function; - a call through `table[i](...)` reaches each function a bare array lists, the dispatching file's array when several share the name. Where upstream keys by a struct's name, this pass keys by its definition: a name means the one definition of that name in the project, else the one of the file's translation unit (the file and the indexed files its `#include`s reach), else nothing, and a table entry's function is the one of its name in the table's file, else the includer's, else the project's. An ambiguous struct, table or function stays unlinked. From a struct body's first conditional or `#include` on, positional entries are not registered, since a field's position may differ between translation units; designated entries still are. An `#include` resolves to indexed files only for now. C++ calls through a local function pointer bound by `&f` now reach the bound functions (#1172 `cppLocalFnPtrs`), under this pull request's extraction version 23. The synthesis marker moves to 9, so the next sync recomputes the stage, and the synthesis corpus gains a header-built command table, a bare opcode array and a C++ launch through a local pointer. Precision: the twenty corpora and the five framework corpora are identical except the repository itself, which gains the two edges of its existing `ops.c` fixture. redis, SameBoy, git and vim gain only these edges (408, 178, 685 and 428); every edge passes a mechanical check, and the ones reviewed by hand are correct.
A C command table often lives in a file the scan does not index, such as redis's generated `commands.def`, which `commands.c` includes. The function-pointer pass now reads such an include as upstream's `cFnPtrEdges` does (`resolveInclude` over the context's `fileExists` and `readFile`): an `#include "…"` resolves to an indexed file, else to a file on disk, the includer's directory first. It reads a file the index does not hold only when the file lies within the project root, the scan's rules admit it whatever its extension (the default ignores, the root `.gitignore`, `.git/info/exclude` and the configured include and exclude), no symbolic link is on its way, and it is no larger than `indexing.max_file_size`; upstream reads any file under the root. So an excluded first candidate is no file, and the include resolves to the second. Every run of the stage records each path it probed beside the index with its text's hash, or null, under `synthesis_unindexed_inputs` in `project_metadata`. A sync that finds the synthesis marker current reads each recorded path again and recomputes the stage when one reads differently, and the watcher hands an event for a recorded path to the next sync. The marker moves to 10, so the next sync recomputes the stage. The synthesis corpus gains a table in a `.def`. Precision: the thirty corpora are identical except redis-medium, which gains 448 edges from `commands.def`'s command table (430 through `redisCommand.proc`, 18 through `getkeys_proc`), each checked against its `MAKE_CMD` row.
The redux-thunk and Sidekiq dispatch passes took the first of several candidates for a name, as upstream's `reduxThunkEdges` and `sidekiqDispatchEdges` do, so the method an edge reached followed node order rather than the code. A thunk's `dispatch(name(…))` now sorts the name's candidates into four kinds: thunk declarations, constants, functions and methods of the dispatching thunk's file, and all of them. The first kind with a candidate decides: one candidate is linked, several are not, and the dispatch neither falls to the next kind nor prefers the dispatching file's candidate. A Sidekiq enqueue through a qualified name such as `A::Worker` reaches a `perform` only when exactly one class of that name is a worker. Several such classes link none, even when two declarations on one line reach the same method, and the enqueue does not fall back to the last segment; with none it falls back as before. The synthesis marker moves to 11, so the next sync recomputes the stage. Precision: the thirty corpora are unchanged; feedbin's 97 Sidekiq edges, 41 of them through qualified names, each have one worker.
A Vue store's actions, mutations and getters, an RTK Query api's
endpoints and the hooks RTK generates for them were part of the constant
that declared them, so no search, call path or impact query could name
one. Extraction now makes each a function node, porting the store and RTK
shapes of upstream's `extractVariable`:
- an endpoint, a `query`, `mutation` or `infiniteQuery` builder call
under the `endpoints` of `createApi(...)` or `injectEndpoints(...)`,
qualified under the api (`api::getPosts`), spans its `queryFn`, else
its `query`, else its first function option; without one it spans the
builder call, its signature the call's first 80 UTF-16 code units;
- a shorthand binding of `export const { useGetPostsQuery } = api` named
`use...Query` or `use...Mutation` is a function whose signature marks
it as a generated hook, so a component's import and call of it
resolve;
- each member of the `actions`, `mutations` and `getters` objects of
`defineStore(...)`, `createStore(...)`, `new Vuex.Store(...)` or
`new Store(...)` is qualified under the store (`useAuthStore::login`),
as is a member of a declaration named after a collection in a file
that reads like a store, with two different store words such as
`namespaced` and `mutations`;
- in such a file, the collections of a Vuex module's
`export default { ... }` give their members functions of the file.
Only a static key names a member. The rest of an initializer, and the
rest of a module's default export, is walked as before, so the store
call, `state` and an endpoint's other options keep their calls; upstream
walks none of it. A store member's `this.action()` now reaches the
store's own action.
The synthesis corpus gains an RTK api with a component, a Pinia
consumer, and a Vuex module with its dispatcher, for the dispatch passes
that follow. Precision: 28 of the 30 corpora are unchanged;
typescript-large gains three hooks and one Vuex mutation, the
repository's synthesis fixture one Pinia action. A Pinia app gains 26
store members; redux-toolkit's query examples gain 39 endpoints and 31
hooks, whose 65 imports and calls now resolve. Each new node was checked
against its shape in the source.
A component that calls an RTK Query hook, a Pinia store's action or a
Vuex `dispatch('user/login')` reached nothing past the call, because the
link runs through a naming convention or a string key, not a static
edge. The synthesis stage now ports upstream's three passes over the
nodes the store and RTK extraction gives:
- rtk-query: a hook RTK Query generates reaches the function of its
endpoint's name in the hook's file (`useLazyGetPostsQuery` names
`getPosts`);
- pinia-store: a call on a variable a file binds to a store,
`const cart = useCartStore(); cart.add(item)`, reaches the store's
action from the function around the call, or from the file's one
component when the call is outside every function;
- vuex-dispatch: a `dispatch` or `commit` of a string key reaches the
action or mutation its last segment names in a file that reads like a
store: the one whose path has the key's namespace as a segment, or for
a root key the one of the dispatching file, else the project's only
one.
Where upstream takes the first or the last candidate, one candidate
links and several none: an endpoint name twice in its file, a factory
name two files define, a variable bound to two stores, two functions of
the action's name, two components, or two store files of the namespace.
A Pinia consumer file links at most 80 calls and a Vuex file at most
120. RTK Query runs for the JavaScript family; Pinia and Vuex also for
a project of Vue files only. The synthesis marker moves to 12, so an
index built before is synthesized again on its next sync.
Precision: the 30 corpora are unchanged. vue-element-admin gains 59
Vuex edges, a Pinia app 25, vben 3, and redux-toolkit's query examples
27 hook-to-endpoint edges; each was checked against its source line.
GoFrame binds a route reflectively: the path lives in the `g.Meta` tag of a request type, and the controller method that serves it takes that type by pointer, under a name of its own (`DeptSearchReq` is served by `List`). The index had no route for it and no edge to the method. A GoFrame resolver now ports upstream's: in a project whose root `go.mod` requires `github.com/gogf/gf`, each request type whose first field is a `g.Meta` with a `path:` tag, outside comments, is a route named `METHOD /path` (`ANY` when the tag names no method). The synthesis stage's new goframe-route pass joins each route to the Go method taking its request type by pointer: the package-qualified type first, the bare type for a same-package or aliased parameter, narrowed to the controller directories and then to the route's own addon, one handler or none, and at most 2000 edges. Where upstream's bare fallback takes a method whose qualified parameter is another route's request type, that method is left to its own route. The synthesis marker moves to 13, so an index built before is synthesized again on its next sync. Precision: the 34 corpora are unchanged. gf-demo-user gains 7 routes and 7 edges; hotgo's server 214 routes and 213 edges, 248 and 243 with its addons re-included, each checked by a script that re-derives them from the sources. The default ignore list skips every directory named `addons` (for Godot), which upstream indexes; KNOWN_DIFFS records it.
A link is markup, not a call: `<Link href="/users">`, `<NavLink to>`,
`<router-link to>` and a SvelteKit `<a href>` record no reference, so the
router resolvers, which bind `router.push('/users')`, never saw them, and
neither did a navigation fed by a helper's call,
`router.push(await nextRoute())`. The index had no edge for either.
The synthesis stage now runs upstream's six link passes after the Go
func-field pass. Next.js `<Link href>` and internal `<a href>`, React
Router `<Link>`, `<NavLink>`, `<Navigate>`, v5 `<Redirect>`,
`<LinkContainer>` and `styled(Link)` wrappers (#2132), TanStack `<Link>`
and `<Navigate>`, Vue `<router-link>`, `<RouterLink>` and `<NuxtLink>` by
path or by name, and SvelteKit's internal `<a href>` each draw a
`navigates` edge from the component the link is written in to the route
its destination names in the link's app, at most 24 a component; a
React `to={paths.x.getHref(id)}` is read through the route-config helper
(#2187). The Expo pass draws an edge from a helper a navigation consumes
to each screen of that navigation's app a literal in the helper's body
names, at most eight. Only a destination starting with `/` is read; a
computed, relative or external one, a path or name two routes carry, and
a link in a test file draw nothing.
The passes read the routers' own route tables, built once a stage run,
and resolve imports through a view context: the indexed texts the stage
reads, no edge, and the store's lookups and configuration loaders, whose
files are JavaScript's control inputs. Where upstream lets a Next.js
`<Link href="https://…">` reach the site's own `/`, and reads an Expo
helper against one table for the whole project, the port reads only
`/` destinations and matches the navigation's own app; KNOWN_DIFFS
records both. #2769's prefilter escaping and #2484's `unittests/`
directories stay for the next round. The synthesis marker moves to 14.
Precision: 30 of 46 corpora are unchanged; the other 16 gain 138 link
edges and lose none, every one read against its source.
A SvelteKit route's page component and the `load` and form actions its `+page.ts` or `+page.server.ts` exports run together, but no source line calls one from the other: the framework pairs them by file name. The index held the `/settings` route and its `+page` component, and no edge from the route to the page or from the page to its loader. The synthesis stage now runs upstream's two SvelteKit passes. A `+page.svelte` or `+layout.svelte` under a directory draws a `calls` edge from its one component to every function and method its indexed sibling loader (`.server.ts`, `.server.js`, `.ts` or `.js` of the same name) declares, and to the loader's `load` and `actions` when they are functions, methods, constants or variables. Each page route of the SvelteKit route table draws one to the component of its own `+page.svelte`; `[...rest]` pages are not in the table, as upstream's are not. Where upstream keeps only the first page when two route groups declare the same path, the port joins every page of the table, and a file of two components joins nothing; KNOWN_DIFFS records both. The synthesis marker moves to 15. Precision: 42 of 46 corpora are unchanged; the other 4 gain 112 edges and lose none, every one read against its source.
… them The synthesis stage replaced the synthesized edges by deleting every one and inserting the new list, so each one-file sync rewrote all of them. On koel the Vue template pass of the next change draws 1239 such edges; rewriting them on every sync pushed the WAL past SQLite's automatic checkpoint, which then landed on the stage's commit. `replace_synthesized_edges` now writes only the difference, in the same `BEGIN IMMEDIATE` transaction. Of each identity in the new list the first edge is the one `INSERT OR IGNORE` would write; a stored synthesized row equal to it in every column keeps its row and id, the other stored rows are deleted, and the remaining edges are inserted as `insert_edges` inserts them. The rows it leaves are the ones the full rewrite leaves: a test compares the two over generated histories of base edges, repeated identities and missing endpoints. A stage run that changes nothing writes nothing. A query that lists a node's edges of one kind by row id can now list a kept synthesized edge before a base edge the same sync rewrote, as it already listed rewritten base edges after kept ones. A fresh index writes the stage's edges into an empty set and is unchanged. KNOWN_DIFFS records the difference from upstream's `publish`, which rewrites every edge.
A Vue single-file component's template renders components and binds
handlers, and neither is a call in its script: `<el-button>` and
`<MediaCard>` reached nothing, nor did `@click="save"` or a handler the
script destructures from a composable, `const { close } = useDialog()`.
Only the template's own expressions were the component's calls (#2357).
The synthesis stage now runs upstream's Vue template pass after the JSX
pass. For each `.vue` file, the root template's kebab-case and PascalCase
tags draw a `calls` edge from the file's one component to the component,
function or class of that name, and a component nested under a Nuxt
`components/` directory also answers the name Nuxt auto-imports it by
(`components/media/Card.vue` as `<MediaCard>`). A bare `@event` or
`v-on:event` handler draws one to the method or function it names, and a
name the script destructures from a `use…` composable to that member of
the composable's file; a handler that is an expression binds only through
its own calls. A component draws at most 30. A name the file imports from
a package that a `package.json` on its way to the root declares renders
and calls nothing, and does not fall back to a Nuxt component (#2475).
Where upstream takes the first in node order, the port takes only a
unique candidate: the file's one node of the name, else the project's,
and a Nuxt name only one component has; KNOWN_DIFFS records it. #2790's
manual-mock filter stays for the next round. The synthesis marker moves
to 16.
Precision: 37 of 46 corpora are unchanged; the other 9 gain 1500 edges
and lose none, each checked against the pass's rules and 143 read against
their source.
The synthesis stage gains upstream's Angular template pass. In a project that depends on `@angular/core`, each `@Component` class of an indexed TypeScript file draws edges from its template: a `calls` edge to each child component a tag renders by its element selector, preferring the parent's own app and drawing nothing when two components there answer; a `calls` edge to each own method an event binding calls, the binding as its trigger; a `calls` or `references` edge to each member a property binding, interpolation, structural directive, control-flow block or `@let` reads at render; and a `navigates` edge to each route a `routerLink` of the template, or a `routerLink:` field of the class, names in the component's app. Children and handlers stop at 40 a template, links at 24 a component. A `templateUrl` template the index holds is read as it holds it. Any other is read beside the index through the stage's reader for unindexed files, inside the scan scope and the project root, and recorded in `synthesis_unindexed_inputs`, so a sync that finds it changed recomputes the stage. An inline `template:` is read only when it is a string or template literal, and a link's destination keeps only the arms a navigation call keeps; KNOWN_DIFFS records both. So that a sync pays little for the pass, the Angular router's constant reader, which route naming and navigation calls share with it, compiles each pattern it builds from a name once per reader and remembers each name's declaring file and comment-stripped source; the pass reads its component files' classes, methods and properties with one store query and a template's lines from one line table. The synthesis marker moves to 17, so an existing index recomputes the stage once. The routers golden gains the fixture's two template edges. Precision: 44 of 51 corpora are unchanged; the other 7, the routers fixture and six Angular apps, gain 1347 edges and lose none, each checked against the pass's rules and 122 read against their source.
codegraph_explore gains upstream's "Dynamic-dispatch links among your symbols" section as e8ddc4e2 prints it (#2748, #2751). After the Flow, or on its own when there is none, it lists the synthesized edges at the symbols the query names, one line per pair of ends, whether or not the query names the other end: `- Shape.area → Square.area [dynamic: interface → impl @square.ts:4]`. Two same-name ends are each named by their owner. An edge with both ends on the Flow is left out, and so is a line that reads like a Flow hop or a line already listed. At most six lines are listed. Links into a low-value file through an end the query did not name go last; before them, links whose ends the query names more precisely come first; links of one rank take turns by the named symbol they hang from, so one symbol's fan-out cannot fill the list; and the order upstream reads a node's edges in (kind, the other end, line, column) settles the rest, so a synced index lists the same lines as a fresh one. The section also covers a query that names one callable, or only non-callable endpoints such as RTK thunks, and the hop of a two-node chain (#687). Explore's low-value files are now upstream's `isLowValue` as b635dd46 wrote it, shared by the hard filter and the links' order: an `e2e/` tree and `_unittest.` files are no longer low-value; `specs/`, `test_*.py`, `FooTest.java` and the like are; and `icon` and `i18n` count only as whole words, so `lexicon.ts` is kept. Upstream has since moved both onto its engine-wide test predicate (#2557); that is left for the next round. No graph changes. Precision: on twelve corpora every printed link matches a synthesized edge of the index, and every other output change traces to the section's share of the output budget or to a file whose low-value judgement changed.
…directories Two of the function-pointer pass's unit tests deleted their temporary directory while the test's store still held the index open. Windows refuses to delete an open file, so both failed there with os error 32; Linux and macOS allow it. Drop the store first, as the synthesis stage's other tests do. The second test needs it twice: its second store shadows the first one without dropping it.
The website compiles every page as a Vue template, and VitePress leaves
inline code to Vue, so `{{ ... }}` inside backticks is an interpolation
there. The Angular template text the synthesis docs added failed the
site build in architecture.md and rendered as empty code in
data-model.md and equivalence.md. The Vue template text in
equivalence.md and embedded-extraction.md has rendered as empty code
since v0.55.0.
Wrap those six code spans in <span v-pre>, the escape the VitePress
docs give. GitHub drops the attribute and shows the code unchanged.
The outdated-migration test of the synthesis marker formatted a SQLite `file:` URI from the platform path. On Windows that path is `\\?\C:\...`, which SQLite does not take as a URI, so the open failed there. Build it with the upgrade tests' `sqlite_file_uri`, which drops the verbatim prefix, uses forward slashes and percent-encodes the rest; the read stays immutable and read-only.
…at re-extraction left out A sync of a file that holds framework nodes, such as a React Router route, scanned every unresolved reference written with `.` or `::`. Re-extraction makes no framework nodes, so comparing the file's stored nodes with the re-extracted ones touched their names; the framework passes then put the same nodes back, and the retry by those names woke references whose candidates had not changed. On LibreChat, a one-file sync of its React Router table spent 48.5 ms in that scan; on a CI runner the sync's median dropped from 0.719 s to 0.660 s. A sync now keeps the stored nodes of each file whose comparison touched a name. Once the framework passes have run, it compares each kept file's nodes with them again by the same rule, and when none touches a name it retries no reference by name. A name touched any other way (a language lane, a removed file, a Python re-export or module global), a framework node written or changed in a file the sync did not compare, a cross-file route table that changed, or more stored nodes than the check keeps, leaves the retry as it was. The graph does not change: the retry is skipped only when the nodes compare equal to what they were before the sync.
Express and Astro projects had no routes in the index and no framework
edges. Two resolvers now port upstream's.
Express (upstream #2200, #2243, #2244, #2261, and #1957) is detected by
an express, fastify, koa or hapi dependency, or by a JavaScript or
TypeScript file under routes/, controllers/ or middleware/ that mentions
Express. Each `app.<verb>`, `router.<verb>` and `app.route(...).<verb>`
call is a route, with a reference to its named handler or the calls of
its inline handler and its reply calls. Only the last argument decides
whether the handler is inline, so a route keeps its named handler when a
middleware before it holds an arrow function, and strings, regex
literals and type arguments no longer end an argument early (#1957). A
router mounted with `X.use('/prefix', ..., target)` names its routes by
the path a request takes to them, the prefixes composed down the mount
tree; a router mounted at two paths keeps its own names. Middleware,
controller and service names resolve only to a declaration in the
reference's own file.
Astro (upstream #2245, and the Astro half of #2267) is detected by an
astro dependency or any .astro file. Each file under src/pages is a
route: a page calls its own component, an endpoint references its
exported verbs. The `Astro` global and the `astro:*` modules resolve to
their own source, and a PascalCase name in Astro markup to the component
of that name in its directory, or the project's only one.
Express registers first and Astro between Angular Router and Expo
Router, as upstream orders them. Express answers below 0.9, so ahead of
the others it decides a reference only on a confidence tie.
Kept Rust behavior, recorded in KNOWN_DIFFS: the mount rename touches
only Express's own routes, and a sync gives a route its file's name back
once no mount renames it; a name pattern with two candidates proposes
nothing, where upstream takes the first its store returns; the
middleware and controller fallbacks are not ported; Astro resolves
`Astro.redirect()` and the like to their own source whether or not
another file declares `redirect`; framework references carry no
`candidates`. The shared route-naming heuristic (#2225) lands with the
first resolver that calls it.
The servers golden gains three Express routes, `USE /api`,
`GET /health` and `GET /api/users/:id`, and their edges.
Precision: 45 of 54 corpora are unchanged and one more indexes the same
graph. The other eight gain Express or Astro routes and edges; every
renamed route was checked against its mount chain, and the 33 wrong
edges found come from upstream's own extraction rules.
…naming
Django, Flask and FastAPI projects had no routes in the index and no
framework edges. Three resolvers now port upstream's `python.ts`.
Django is detected by `django` in a root requirements.txt, setup.py or
pyproject.toml, or by a root manage.py. Each `path`, `re_path` and `url`
call is a route that references its handler by its last name, with
`.as_view(...)` and one trailing call dropped; `include('x.urls')` is an
import of that module, and a DRF `router.register` of a view set is a
`VIEWSET` route. Model, view and form names resolve by name, preferring
a models, views or forms folder.
Flask is detected by a root manifest that names flask, or by an entry
script that imports flask and calls `Flask(`. An `@x.route` decorator is
a route with the first method it lists, a Flask-RESTful `add_resource`
call is an `ANY` route of its resource class, and `add_url_rule` and a
wrapper that hands a path list and `view_func=` over are routes too
(upstream #2154). Blueprint names resolve to their variables.
FastAPI is detected by a root manifest that names fastapi, or by a
main.py, app.py or api.py that calls `FastAPI(`, at the root or at most
four path segments deep (from upstream 950686de). Its decorators are
routes, and a router's routes are named by the path a request takes to
them (from bc45e907): `APIRouter(prefix=...)` and literal
`include_router(..., prefix=...)` prefixes compose down the mount tree.
Router and dependency names resolve to their declarations.
The three name heuristics share one module, the port of upstream's
#2225: a name resolves to a declaration the reference can see, in its
own file first, then its directory, then a preferred folder. The
resolvers that follow reuse it.
The root files the detections read are no source files, so a sync could
miss a framework coming or going. They are now a control input of their
own, `control_inputs:python`; when one changes, the sync detects the
frameworks again.
Kept Rust behavior, recorded in KNOWN_DIFFS:
- a heuristic tier with two candidates proposes nothing, where upstream
takes the first its store returns, and a pick in another code family
answers nothing;
- the heuristics guess no name the reference's file imports, as upstream
leaves an imported React component to import resolution (#2120): a
`Group` netbox imports from svgwrite no longer links to a project
model;
- no exact-name match reaches a route. A Django route is named by its
URL, which can read like an identifier: drf's `path('path', ...)` took
37 references to Django's own `path`, and three routes named like
their handlers took their own handler references;
- FastAPI renames only its own routes, and a sync gives a route its
file's name back once no mount renames it.
Not ported yet: Django's ORM dispatch from `_iterable_class` to
`ModelIterable.__iter__`, which needs a sync lane that reads it, and
FastAPI mounts through an absolute import, which wait for upstream's
Python package roots (#1921).
The servers golden gains `GET /hello`, `GET /ping` and
`GET /items/{item_id}` and their handler edges.
Precision: 52 of 63 corpora index identically. The other eleven gain
Django, Flask or FastAPI routes and edges; every renamed route was
checked against its mount chain, and every edge into a route was
checked. The two wrong-edge families found are fixed by the rules
above.
Spring and Play projects had no routes in the index and no framework edges. Two resolvers now port upstream's `java.ts` and `play.ts`. Spring is detected by a root pom.xml, build.gradle or build.gradle.kts that names spring-boot or springframework, or by a .java file holding @SpringBootApplication, @RestController, @service or @repository. Each @GetMapping, @PostMapping, @PutMapping, @PatchMapping, @DeleteMapping and method @RequestMapping is a route under the class's @RequestMapping prefix that references the method it annotates. A mapping may list several paths or name a same-file String constant (upstream #1461 and #1811). Spring's config files, application or bootstrap with an optional profile as .yml, .yaml or .properties, hold one constant per leaf key, and only the key is stored, never the value (#722). An @value("${key}") or @ConfigurationProperties(prefix) binding is a node whose reference binds to the key through relaxed binding: one key at 0.9, of several the base file's at 0.75, a prefix to the shortest key under it at 0.85. As #1180 has it, only dotted Java and Kotlin references reach the keys, the keys are read once per resolution, and name matching never resolves a call to a config key. Spring's dependency-injection conventions (Service, Repository, Controller, entity, and Component or Config names) answer Java and Kotlin references other than extends and implements (#1827), through the shared name heuristic, which starts from the reference's own file and package (#2222). Play is detected by a root build.sbt that names Play, by conf/routes or conf/application.conf, or by a routes file anywhere in the project, so a project in a subdirectory is Play too (#2156). conf/routes, a file ending in /conf/routes and a *.routes file are now indexed as YAML files, as upstream's isPlayRoutesFile has it. Each routes line is a route whose Controller.action reference resolves to the first method or function of that name in a file of a class so named. Framework claims now pass the resolution pre-filter only for the resolvers that read the reference's language, as upstream has it. Play claims every X.y name, which would otherwise keep every such reference of a Play project past the filter. The root files the detections read are a control input of their own, `control_inputs:jvm`. A sync re-resolves the references a key can bind when it rebuilds or removes a config file, and the routes lines naming a class or action it adds, removes or moves into another language, with `play_routes_version` as the Play lane's crash marker. Kept Rust behavior, recorded in KNOWN_DIFFS: - a binding's reference takes only Spring's answer. Upstream lets name matching outrank Spring's 0.75, which links a key two files hold to the profile file listed first, and a loosely spelt key to the binding node itself; - of config keys that rank alike, the one in the binding's own module wins, then the first by path: in mall, five mall-portal bindings read mall-portal's keys, not mall-admin's; - a convention rule whose pick answers nothing ends the chain, so a later rule does not guess again with other kinds and folders; - of the classes named as a routes line's controller, Play takes the one nearest the routes file and answers nothing on a tie or across code families, where upstream takes the first in its store's order: in play-samples, whose projects each hold a HomeController, that linked most projects' routes to one project's controller; - Play reads only routes lines, and a routes line takes no other strategy's answer: upstream's guess linked two Scala calls of one sample to Java methods of another. The servers golden gains the Play routes file and the routes GET /users/{id}, GET / and GET /items/:id with their handler edges. Precision: 60 of 67 corpora index identically. The other seven gain Spring or Play routes and edges. Every Spring route edge of mall, every Play routes edge of play-samples and every binding of mall and spring-petclinic was checked against the source; the three wrong-edge families found are fixed by the rules above. In mall, 9,369 type references keep their targets and become Spring's convention edges at 0.7, and twelve references in mall and plugin-moments move from a same-named constructor or field to the class.
Laravel and Drupal projects had no routes in the index and no framework
edges. Two resolvers now port upstream's `laravel.ts` and `drupal.ts`.
Laravel is detected by a root artisan or app/Http/Kernel.php. Each
Route::get, post, put, patch, delete, options and any call is a route,
and each Route::resource or apiResource call a resource route. A
route's handler, an [C::class, 'm'] tuple or a 'C@m' string, resolves
to the method in app/Http/Controllers/{path}.php, else in a class of
that name under a Controllers directory. A string controller needs no
Controller suffix and keeps its namespace path below the controllers
root (upstream #2271). A resource route imports its controller class,
and a Model::method reference resolves in app/Models/C.php or app/C.php.
Routes are named by the path a request takes (#2099): a leading slash,
the prefixes of Route::prefix and Route::group groups (a computed one as
{prefix}), routes/api.php under /api, and the prefixes of the files that
mount a routes file through a group, require, loadRoutesFrom or Laravel
11's withRouting, composed down an include tree. Every sync recomputes
the names, so a mount that goes away is undone.
Drupal is detected by a root composer.json with a drupal/ dependency, a
drupal/ name or a drupal- type, else by an indexed .info.yml together
with a routing, module, install or theme file (#271, and upstream
025ebc88's detection and claims). Each route of a *.routing.yml file is
a route node with one reference per handler; a controller resolves to
its method, else its class, and a form to its class. A .module,
.install, .theme or .inc function implementing a hook, by its docblock
or by its module's name prefix, references hook_X, which resolves to a
function named hook_X when the project defines one, else to the hook's
one implementation in a hook file.
The detection inputs are a control input of their own,
`control_inputs:php`. A sync re-resolves the Laravel route references
naming a class or file that a controller file change adds or removes,
and the Drupal handlers and hooks that a PHP file's classes, methods or
hook functions touch, with `laravel_routes_version` and
`drupal_refs_version` as the two lanes' crash markers.
A Laravel route's handler class now reads through the routes file's use
imports, as upstream's isPhpClassVisible (#2235) reads it: the route's
reference sits at column 0, where no class name could be read back, so
koel's 90 invokable-controller routes linked to nothing.
A sync that touched four or more names no longer walks every PHP,
Pascal and CFML node to find the edges into those names in any case.
Lacking row statistics, the planner took the language filter for the
selective one; the query now starts from the targets, through the
lower-name index, and finds the same sites. Re-extracting a routes file
touches all its route names, so every edit of koel's routes file paid
25 ms for this.
Kept Rust behavior, recorded in KNOWN_DIFFS:
- where upstream takes the first of several candidates in its store's
order, Laravel and Drupal take the only one and answer nothing for
several: in akaunting, 25 resource routes' controller paths end two
controllers' paths, one meant by each routes file;
- their candidates are PHP classes and functions;
- Laravel claims only its routes' references, and Drupal only its
routing files' and the hook_X names: upstream's claims let every PHP
`use Foo\Bar;` reach Drupal's namespaced-class rule, which links it to
any project class Bar, and no sync revisits that edge;
- a Drupal routing file's reference takes no other strategy's answer:
instance-method matching linked four of drupal/drupal's _entity_form
routes to an entity class's method named for the operation.
The servers golden gains a root artisan and a Drupal module's .info.yml,
with the routes GET /users, GET /admin/stats, GET /ping and /hello and
their handler edges.
Precision: 66 of 70 corpora index identically. koel, akaunting and
bookstack gain Laravel routes and edges, and drupal Drupal's; every
framework edge, and koel's 90 route edges by name, were checked against
the source.
Rails projects had no routes in the index and no framework edges. A
resolver now ports upstream's Rails resolver from `ruby.ts` as it
stands at e8ddc4e2.
Rails is detected by a root Gemfile naming the rails or railties gem,
else a root config/application.rb,
app/controllers/application_controller.rb or config/routes.rb, else an
indexed config/routes.rb at any depth, so an engine's routes count too.
A routes file, one that calls routes.draw or sits in a config/routes/
directory, is read with its blocks (#2155): namespace and scope with
their path and module options, resources and resource with their path
and controller options, a nested resource under its parent's
:{singular}_id, member and collection routes, root and the verb
routes, each route named by the path a request takes. Any other Ruby
file contributes its explicit routes and resources lines, read flat.
only: and except: are read as an array, a %i or %w list in either
bracket, a symbol, a string, or the older :only => form (#2269).
A route's controller#action resolves to the action in
app/controllers/{controller}_controller.rb, else in the file of the one
Ruby class named for the controller's last segment that holds it; when
the route names a module and some of those classes sit in its path,
only they count. A CamelCase name resolves to its model in app/models,
a name ending in Controller to its controller class, and one ending in
Helper, Service or Job to the module or class of that name in its
conventional file.
The Gemfile is not indexed, so Rails' four root detection files are a
control input of their own, `control_inputs:ruby`. A sync re-resolves
the route references that read a file whose Ruby class, method or
function names it changed: those naming one of the file's classes, and
those naming the file as their conventional controller file, with
`rails_routes_version` as the lane's crash marker.
Kept Rust behavior, recorded in KNOWN_DIFFS:
- where upstream takes the first of several candidates in its store's
order, Rails takes the only one and answers nothing for several: a
route's action among the controller classes' files, a model among
the classes in a path holding app/models/, and a controller among
those in a path holding controllers/;
- its candidates are Ruby classes, modules, methods and functions.
The servers golden's rails/ app now has its nine routes, with
users#index, users#show and admin/reports#index linked to their
controllers' methods and six references left unresolved.
Precision: 68 of 72 corpora index identically. feedbin, maybe, solidus
and the repository snapshot gain Rails routes, and all 730 route edges
reach a method named for the action. Model and controller references
that name matching had linked now take Rails' 0.8 and 0.85, as
upstream links them.
Editing a routes file now re-extracts, writes and resolves its routes,
as upstream does: 0.19 to 0.27 ms per route on a CI runner, 46 to 71 ms
for routes files of 248 to 267 routes. Every other measured sync and
init is within the performance lines.
…roups ASP.NET projects had no routes in the index and no framework edges. A resolver now ports upstream's ASP.NET resolver from `csharp.ts` as it stands at e8ddc4e2. ASP.NET is detected by an indexed .csproj naming an ASP.NET SDK or package, a root Program.cs that builds a web host, a root Startup.cs, else an indexed controller, program, startup, endpoint or extensions file holding an ASP.NET marker. Neither side indexes .csproj files by default; the first rule fires when a project's extension configuration indexes them. Routes come from four forms, read on comment-stripped text: verb attributes under the class's [Route] prefix, each referencing the action method declared after it; minimal APIs, whose path now starts with a slash (#2158) and which reference their handler's tail identifier; endpoint groups, named under the class's RoutePrefix or the app's MapGroup head; and FastEndpoints endpoints (#2158), whose verbs in Configure() take a literal path, a nameof() part or a constant whose value names the route, and reference HandleAsync or ExecuteAsync. References resolve by upstream's conventions through the shared name heuristic (#2225): a name ending in Controller, Service, Repository, ViewModel or Dto, an interface's I prefix, and a CamelCase model, each preferring its conventional folders. Razor references resolve too (#2415), so a page's @model reaches the PageModel beside it. The root Program.cs and Startup.cs may be excluded from the index, so they are a control input of their own, `control_inputs:dotnet`. Every sync recomputes the constant and group route names; no lane or marker is added. Kept Rust behavior, recorded in KNOWN_DIFFS: - a convention whose pick declines ends the chain, where upstream takes the first candidate and tries the next only when none exists; - a constant route is renamed only when the classes of its name give one value, and a route whose constant or group head is gone gets back the name its file gives, where colby's sync keeps the old name. The servers golden's aspnet/ app now has its two routes, GET /api/[controller]/{id} referencing UsersController.Get and GET /hello, whose handler is a lambda. Precision: 70 of 75 corpora index identically. The repository snapshot, clean-architecture, ardalis/CleanArchitecture, aspnetcore-realworld and eShopOnWeb gain their 88 routes, each checked against its file. 1121 references that name matching had linked keep their targets at the conventions' confidence. Where an action method shares its name with a class, or a member is read through a property named for its type, the class now wins, as upstream links them. On a CI runner, init, sync and peak memory stay within the performance lines on the seven measured corpora. Re-syncing an edited endpoint group, FastEndpoints endpoint, controller or Razor page takes 1.05 to 1.10 times as long as before.
Swift projects had no framework resolver: a Vapor app had no routes in
the index and no framework edges. Three resolvers now port upstream's
SwiftUI, UIKit and Vapor resolvers from `swift.ts` as it stands at
e8ddc4e2, registered after ASP.NET in upstream's order. They answer
only Swift references, #2242's Swift half.
SwiftUI is detected by `import SwiftUI` in an indexed .swift file or an
indexed .xcodeproj or .xcworkspace path, UIKit by `import UIKit`,
`UIViewController` or `UIView` in an indexed .swift file, and Vapor by
a root Package.swift holding `vapor`, else `import Vapor` in an indexed
.swift file.
References resolve by upstream's conventions through the shared name
heuristic, #2225's Swift half: SwiftUI's view structs, view-model, store
and manager classes and capitalized models; UIKit's view controllers,
views, cells and delegate or data-source protocols; Vapor's controllers,
Fluent models and middleware, each preferring its conventional folders.
Vapor routes come from three forms, read on comment-stripped text:
`use:` routes under the receiver's `grouped` or `group` prefix, matched
by #1547's linear pattern; trailing-closure routes, `webSocket` among
them; and `on(.METHOD, ...)` routes (#2157); each named `METHOD /path`.
A `use:` handler resolves to the method on the type its route names, or
to a function in scope for a route outside any type, never by its name
alone (#2106). A closure route calls what its closure calls (#2273).
A handler's choice reads other files' methods, the types around them
and their first lines, which no name records, so the new `vapor_routes`
lane re-resolves the route handlers that name a Swift method or
function a sync's changed files declare before or after the change, and
the `vapor_routes_version` marker re-resolves every file holding a
Swift route's reference in an index written without it. The root
Package.swift may be excluded from the index, so it is a control input
of its own, `control_inputs:swift`.
Kept Rust behavior, recorded in KNOWN_DIFFS:
- a convention whose pick declines ends the chain, where upstream takes
the first candidate and tries the next only when none exists;
- of one type's overloads of a handler, the sole one taking a `Request`
handles the route, and none or two leave it unresolved, where
upstream takes the earliest.
The servers golden's vapor/ app now has its two routes: GET /hello,
which calls greeting, and GET /todos under `routes.grouped("todos")`,
which references TodoController.index.
Precision: 74 of 80 corpora index identically. The repository snapshot,
Alamofire, SwiftPackageIndex-Server, CodeEdit, the IVPN iOS app and
clean-architecture-swiftui differ, SwiftPackageIndex-Server with 37
routes, each checked against its file. 2224 references that name
matching had linked keep their targets at the conventions' confidence.
Eight others change as upstream's rules link them: a SwiftUI view struct
now wins over a UIKit view class of the same name twice, and Vapor's
model convention, through the Swift type gate, moves two references off
the nested type they name onto a Fluent model and one onto another
file's nested type of its name, leaves one unresolved, links a test
helper's `@Tag` to the app's private `Tag`, and links one more
precisely.
On a CI runner, init, sync and peak memory stay within the performance
lines on the six measured workloads across five corpora. Re-syncing an
edited Vapor routes file takes 1.09 times as long as before, and an
edited controller whose handlers the new lane re-resolves 1.00 times.
…rates
Rust projects had no routes in the index and no framework edges. A
resolver named `rust` now ports upstream's Rust resolver from `rust.ts`
and its Cargo workspace crate map from `cargo-workspace.ts` as they
stand at e8ddc4e2.
Rust is detected by a root Cargo.toml, read whether or not it is
indexed. A manifest below the root, a workspace member's or a
fixture's, detects nothing.
Routes come from three forms, read on comment-stripped text: attribute
routes (actix's and rocket's #[get("/users")]), each referencing the
next fn; axum's .route("/users", get(a).post(b)), one route for each
method router at the call's top level, none for a get( inside a closure
handler; and actix's builder API, web::resource("/p") chains with
web::METHOD().to(h) and an ANY route for a leading .to(h), and App-level
.route("/p", web::get().to(h)). An axum or builder route stays on its
.route line, and its reference to the handler sits where the handler's
last segment is written (#2359), so the scope rule reads the handler's
own line.
References resolve by upstream's conventions through the shared name
heuristic (#2225): a ..._handler or handle_... function, a ...Service or
...Repository struct or trait, and a CamelCase model struct, each
preferring its conventional folders; and a lowercase name as a module,
the root's src/<name>.rs or src/<name>/mod.rs, else a workspace crate's
src/lib.rs or src/main.rs. The heuristics take only a name the Rust
scope rule lets the reference see (#2224, and #2214's framework half):
no item inside a function body, and no project item where the name is
an outside crate's import or a path through one.
The crate map (#151) reads the root manifest's [workspace] members,
expands glob members through a directory listing the resolution
contexts now offer, and maps each member's [package] name and its `_`
alias to the member's directory.
The module rule links a file node, which no reference's name reaches,
so a sync that adds or removes a root module or a crate root retries
the references named for it: unresolved ones by name, resolved ones at
their sites. So does a sync that keeps one whose file node comes or
goes: a file over max_file_size stays tracked without any node. A new
marker, rust_crate_roots_version, makes a sync that finds it missing
re-resolve every Rust file. The workspace's manifests are the Rust
control kind's inputs.
Kept Rust behavior, recorded in KNOWN_DIFFS:
- a convention whose pick declines ends the chain, the module rule's
too, where upstream tries the next rule only when no candidate exists;
- a module is its file node, where upstream takes the file's first node;
- a workspace's members stay inside the project: an absolute member
(`/` included) or one leaving the root, and a glob whose static
prefix is one, are neither read nor listed; a glob's walk is sorted,
a name two members give names neither, and a glob reads the
picomatch forms a Cargo workspace writes;
- a builder route's handler column is a byte column, as the Rust scope
rule reads it.
The goldens are unchanged, every corpus identical under
scripts/regen-goldens.sh --check: no golden fixture has a root
Cargo.toml (the servers corpus keeps its axum/ and actix/ manifests one
level down), so none detects Rust.
Precision: 78 of 84 corpora index identically. This repository's
snapshot, tokio, realworld-axum-sqlx, axum, actix/examples and
crates.io differ; git detects Rust and is unchanged. The four corpora
#2359 validated link as many routes to handlers as it reported at the
same commits: 19, 204, 116 and 5. 2288 `use` declarations of workspace
crates now import the crate's root file, 4 of them for a registry
crate named like a member, and 3755 references keep their targets at
the conventions' confidence. Of 453 references that move, 389 reach
the declaration the name means, among them 279 `&Store` parameters
here that leave the core crate's trait for the store's struct, and 9
are wrong before and after. 55 move away from the right target, as
upstream's rules move them: a model struct wins a tie with name
matching (17) or outranks it (2), and the model rule answers
`implements`, so crates.io's 36 `impl BackgroundJob for` leave the
worker trait for a struct of that name and the 36 trait-dispatch calls
synthesized from them go. The module rule also newly links 12
lowercase names in crates.io to root module files they do not mean:
builder calls such as `.config(`, the registry `sentry` crate and a
member's own `cloudfront` module.
On a CI runner, init, sync and peak memory stay within the performance
lines on the seven measured workloads across five corpora. Re-syncing
an edited actix-examples main.rs takes 1.12 times as long as before,
an edited axum routing test 1.10 times, and an edited Cargo.toml 1.03
(tokio-stream) and 1.06 (axum-extra) times.
Go projects had no Gin, Echo, Fiber, Chi or net/http routes in the index, and their bare handler and type names had no framework conventions. A resolver now ports upstream's Go resolver from `go.ts` as it stands at e8ddc4e2. Go is detected by a root go.mod that is not empty, indexed or not, else by an indexed .go file. The root go.mod is already a control input and a .go file appearing or going is an ordinary change, so no control kind, lane or marker is added. Routes are read on comment-stripped text (#89): each call of a verb on any identifier (#365), Gin's and Echo's GET to HEAD, Chi's and Fiber's Get to Delete, or net/http's Handle and HandleFunc, is a route that references the last identifier of its handler. Its first argument must be URL-shaped (e1f339f, #1308, fixing #1259): a path that starts with a slash, or on Handle and HandleFunc a Go 1.22 pattern such as "GET /users/{id}", which names the route's method, so cache.Put("key", v) is no route. A group's prefix is not applied, as upstream has no mount pass. References resolve by upstream's four conventions through the shared name heuristic (#2225): a function for a name ending in Handler or starting with Handle, a struct or interface for one ending in Service, Repository or Store, a function for one ending in Middleware or starting with Auth or Log, and a type of any kind for a PascalCase name. These carry the framework halves of #2397 and #2408: an embedded type is left to name matching and the import resolver, and a convention guesses only a name written bare, among the declarations of the reference's own package, its own file first. Kept Rust behavior, recorded in KNOWN_DIFFS: a tier answers only through its one candidate, and a convention whose pick declines ends the chain, where upstream takes the first candidate. In valid Go the stop changes no result. Not ported: #2784, which links a conversion such as (*Error)(nil) as a reference; here it stays a call, promoted to instantiates for a struct. Two golden corpora change, regenerated with scripts/regen-goldens.sh --write and logged in docs/equivalence.md: servers gains the route GET /ping in gin/main.go with its reference to ping, and synthesis gains GET /users and GET /inline in go/gin/app.go, the first referencing getUser, while its four edges to the two Discovery structs keep their targets and confidence and gain the framework's tag. Precision: 78 of 89 corpora index identically, gf-demo-user among them (its routes are GoFrame's). The six earlier corpora that detect Go and change, and the five Go corpora added for this commit, gain every route an independent mirror of upstream's extraction finds in them; chi has 236, the 212 e1f339f reports plus routes chi's tests added since. 532 references keep their targets and gain the framework's tag, and 338 gain confidence, each in the reference's own package. Two cases go as upstream's rules go: gin's build-tag twins of Binding leave ten references to name matching, and thirteen (*T)(nil) interface checks leave a method named like the type for the render package's struct. On a CI runner, init, sync and peak memory stay within the performance lines on gin, prometheus, hotgo, this repository and librechat; re-syncing gin's routes_test.go, 64 routes, takes 1.04 times as long as before.
A web app's tiers talk over wires the graph could not see: a client's request to its server's route, a job put on a queue, an event sent on a bus or a socket, and a test's request to the route it tests. Two synthesis passes now port upstream's tier-synthesizer.ts as it stands at e8ddc4e2: the cross-tier channels (F8) and the test requests (#2100). The cross-tier pass reads each indexed JavaScript or TypeScript file that is no test or generated file. A client call inside a function (fetch, $fetch, ofetch, axios, ky, got, useFetch, useSWR, or a member call on a client: an axios.create or ky.extend instance the file or an import binds, or a receiver named like a client) whose first argument is a literal path reaches the one route its method and path denote, the path joined to the instance's base URL. A template hole fills a route parameter, a hole before the path matches a route by its tail, and a tie, a variable URL or a call on a registration's line draws nothing. A job reaches its queue's most specific consumers (an @process method of the @processor class, a worker host's process, a BullMQ Worker or Bull's queue.process), an event its @onevent handlers, globs honoured, and a socket's emit the other side's @SubscribeMessage and socket.on handlers. More than six consumers, handlers or dispatches of one event draw nothing. The pass runs before the emitter pass, so a pair both draw keeps the edge that names the tier it crosses. The test-request pass (#2100) reads each Spring or Laravel test file: a MockMvc builder, Kotlin's MockMvc DSL, WebTestClient, RestAssured and restTemplate calls, a Laravel request on $this, directly or through a test's own helper, and Pest's request functions. Each reaches the route its literal path names, from the test method, or from the file for a Pest closure. The viewer's fan-in leaves these edges out, as upstream's countIncomingEdges does, so a route forty tests hit is no hub. Both passes match on comment-stripped text aligned byte for byte with the source, so a column counts its line's UTF-16 code units as upstream's blanking leaves them. The regexes are upstream's, rewritten for the regex crate where JavaScript's lookbehinds and backreferences have no counterpart; unit tests run each rewrite on upstream's own inputs. The stage gains enclosing_value beside enclosing_fn, and the synthesis_version marker moves to 18, so an index at 17 recomputes its synthesized edges on its next sync. Of b1f40c57, whose rest this lands, Rust already had the hop wording, the routing manifest's constant handlers, the workspace package manifests, the e2e/ test directory (W6-09, #322), Express mounts on route names (W7-19a) and the route href helpers. Its Steps picture (steps.ts, route-roots.ts, when.ts and the viewer's step nodes) and the Steps labels are left to W7-22. Kept Rust behavior, recorded in KNOWN_DIFFS: a receiver's imported bindings and a Laravel helper's body are read through the view, from indexed text that matches its file row, and the import resolves among the indexed files only. Where an excluded or oversized api.ts precedes an indexed api/index.ts among an import's candidates, upstream reads the excluded file from disk and this pass takes api/index.ts. Two sync-convergence cases with such an excluded candidate are registered as ignored: base import resolution still probes the disk for it, which predates this commit. The tier edges converge there, as tier_edges_converge_beside_an_excluded_import_candidate checks. Precision: of 107 corpora, 92 graphs are unchanged and 15 only gain edges, 1,559 in all, each equal to an independent model of upstream's passes in source, target, kind, provenance, metadata and line. Of 264 sampled edges 260 are right; upstream draws the other 4 as well (an external URL and a bench fixture route matched by their tails, and a fetch in a minified one-line file whose enclosing function is taken by line). Performance (frozen method on GitHub runners, nine valid rounds per measure, against 6a58caa): cold init at most 1.046 of the base on seven corpora, one-file sync at most 1.143 on nine, peak RSS at most 1.023; typescript-large's one-file sync is 1.358 of fec4fbb's (line 1.5).
Mixed iOS and React Native apps had no edge across the language boundary: a Swift call never reached the Objective-C method it bridges to, a JavaScript NativeModules call never reached its native module, and an Expo or Fabric module's native half was never indexed. Five resolvers and four synthesis passes now port upstream's bridges from react-native.ts, expo-modules.ts, fabric.ts, swift-objc.ts, swift-objc-bridge.ts and callback-synthesizer.ts as they stand at e8ddc4e2 (F12, #430, #708). swift-objc-bridge, in a project indexing .swift beside .m or .mm files, links a Swift call to the Objective-C method whose selector bridges from its name (fetchEntry to fetchEntryForKey:, play(song:) to playWithSong:), generic names excluded, and an Objective-C message to the Swift method or function of its first base name that an @objc in its three lines above or its first line exposes, both at 0.6. react-native-bridge, detected by a root package.json naming react-native or a module macro or TurboModule registration in the first 200 paths, extracts an rn-export method node per JavaScript name of an RCT_EXPORT_MODULE file. It reads RCT_EXPORT_METHOD, RCT_REMAP_METHOD, the RCT_EXTERN shims of Swift modules, NativeModules aliases (a name two modules share names none), JVM @ReactMethod modules (getName's literal, else the module or package class without Module) and TurboModule specs. NativeModules.Mod.m() or an alias of it takes module Mod's method at 0.95, or nothing when Mod has none (6557bc83); a call by the method's name alone takes one at 0.6, both preferring Objective-C, then Swift. The React Native bridge and Expo modules' JavaScript side register just before Expo Router, where upstream orders them, so a native call named like a navigation stays the bridge's. expo-modules extracts an expo-module method node per Function, AsyncFunction, Property and Constants declaration of a Swift or Kotlin module, and expo-modules-js (#2134's Expo part) takes a call through a requireNativeModule binding, in its own file or imported, to the module's declarations at 0.95, Swift first and the others as also targets, else to the sole member of the binding's type at 0.9. fabric-view extracts the component and prop nodes of a Codegen spec, a requireNativeComponent call (#2137, with the .js and .jsx languages) and a Paper or Android view manager. The passes draw rn-event-channel edges from a native send to the JavaScript handlers of its event, constant event names included (#2138); fabric-native-impl edges from a view component to its native class; and expo-cross-platform and rn-cross-platform edges between the platforms' implementations of one native method. No pattern is built from a name, which keeps #2769's escaping. Kept Rust behavior, recorded in KNOWN_DIFFS: where upstream takes the first of several candidates (a bridged Objective-C method, an exposed Swift declaration, an export's or RCT_EXTERN entry's or JVM export's target, the preferred platform's method, Expo's type fallback, the event channel's named handler), Rust takes only the sole one, counting distinct nodes. The 0.6 answer is not given for the two reference shapes whose framework candidates upstream's resolution drops: an untyped member chain of three or more segments and a call on a call's result. A sync keeps up with the bridges through a new lane: each file holding a bridge fact keeps an rn_bridge_surface row (aliases, bindings, exports, RCT_EXTERN entries, JVM and spec methods, Swift exposure), resolution reads the unchanged files' rows instead of their text, and a changed row or Objective-C, JVM or Swift method re-resolves the references it can move, unresolved ones by name and resolved ones by site, with no cap. The rn_bridges_version marker bootstraps an older index. The package.json files of the packages, apps, modules and libraries workspace roots that Fabric's detection reads are JavaScript control inputs. The synthesis marker moves to 19. Two more kept Rust behaviors, recorded in KNOWN_DIFFS: a Swift-ObjC or React Native bridge answer below 0.9 gives way to any other candidate whose target is in the reference's own language (TypeScript, TSX, JavaScript and JSX counting as one), so the bridges fill in only where that language has no answer; and the component and prop nodes an Objective-C Paper or a Java or Kotlin view manager mints are no candidate of name matching, while spec-minted nodes and the synthesis passes read them as before. Three resolution differences that predate the bridges are recorded for the next round: the single-candidate shortcut counting candidates before the scope filters, the Expo exception missing from has_bridge_evidence and the partial qualified-name match without a scope boundary. The bridge lane also re-resolves a bridge's weak answer when a declaration of any language named like its reference comes or goes, since that declaration can now outrank or displace it, and the edge's target, named otherwise, is out of reach of the retry by target name. rnXPlatEdges reads its native methods as light rows and asks one query which of them a JavaScript-family node calls, instead of reading every candidate's incoming edges and every caller's row; the React Native maps load only the methods the bridge facts name, instead of every Objective-C, Java, Kotlin and Swift method. The mobile golden gains the rn-export node, the two expo-module nodes, four resolved and four synthesized edges, and loses three unresolved references; every other golden is unchanged. Precision: of 107 corpora, 95 graphs are unchanged and the 12 with a bridge (the repository's fixtures and eleven React Native, Expo and Swift-ObjC projects) change. Against the same commit without the two guards, every changed site, 79 bridge answers and 73 Paper node matches, returns to its earlier target. Of the sampled new edges 618 are right; the 160 wrong ones are the edges upstream draws as well (a bridge answer by name alone, a same-name native pair, a native class taken by its file's first class). Performance (frozen method on GitHub runners, nine valid rounds per measure, against W7-20): cold init at most 1.046 of the base on seven corpora; one-file sync within 1.15 on nine of ten (rn-firebase's Objective-C module file at 1.131); typescript-large's one-file sync 1.444 of fec4fbb's (line 1.5); peak RSS at most 1.033. wikipedia-ios's Objective-C file sync measured 1.171 on one runner and 1.089 on another; about half of its cost is the Swift-ObjC bridge claiming every selector reference past the existence check, as upstream's does, and the owner accepted it as the feature's cost.
cargo-audit now reports five advisories published after the branch's last green CI: the SQLite that libsqlite3-sys 0.38.2 bundles (RUSTSEC-2026-0459), three in rmcp 3.5.1 (RUSTSEC-2026-0457, 0461 and 0462), and one in quinn-udp 0.5.15, which reqwest pulls in (RUSTSEC-2026-0538). rusqlite moves to 0.41, which takes libsqlite3-sys 0.39.1; rmcp moves to 3.11.0 and takes that as its floor, so the lock file cannot fall back to a version with the advisories; quinn-udp moves to 0.5.16 in the lock file only. No code changes.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The v0.56.0 follow-up program: the work split out of v0.55 (OD-18) plus the
items that came after it. This PR stays a draft while the waves land; each
wave is pushed when its local gate passes.
Planned scope:
resolvers)
codegraph context, upstream #1617, and the v1.5.0 performance strategiesW0 (pushed)
graph meaning, so users rebuild once.
upgrade_from_v055covers thev0.55 → v0.56 path (a v0.55 index is
Outdated{22}and upgrades to agraph equal to a fresh
init).StoreError::FutureSchemafrom every opening path (sync, daemon catch-up,MCP sessions,
rebuild), probed WAL-aware before any writable open. Therecovery text offers
uninitonly whereuninitwould succeed.uninit --forcecan still discard such an index.uninit --forcebeside a leftover tombstone: a current index next tothe uninit tombstone is now discarded (the tombstone stays, so only
initrebuilds it), and a newer schema is reported before the tombstone.
std-typed receivers (
PathBuf,&Path) stay unresolved.tree-sitter-swift,which stays at 0.7.3 (0.7.4 regenerates the grammar; documented in
docs/grammar-manifest.md).Verification (W0, HEAD 5cb5f32)
make check: 239 suites, 6135 passed, 0 failed, 1 ignored.make pre-ci(pre-push hook): passed, including the viewer bundle bytecheck and the release-archive smoke.
scripts/regen-goldens.sh --check); graphdiffs over the precision corpora identical before and after the dependency
updates.
within budget.
Not in this PR yet
W7-W10. This description is updated as each wave is pushed.